package com.atbeijing.bigdata.spark.core.acc

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object Spark04_Var_BC {

    def main(args: Array[String]): Unit = {

        val conf = new SparkConf().setMaster("local").setAppName("Acc")
        val sc = new SparkContext(conf)

        val rdd1 = sc.makeRDD(List(
            ("a", 1), ("a", 2), ("a", 3)
        ),2)

        val rdd2 = sc.makeRDD(List(
            ("a", 4), ("a", 5), ("a", 6)
        ),2)

        val rdd3: RDD[(String, (Int, Int))] = rdd1.join(rdd2)

        rdd3.collect().foreach(println)

        sc.stop()

    }
}
